package com.amox.uitest.adapter;

import org.dom4j.Element;

import com.amox.uitest.tcase.BaseTestCase;

import ognl.Ognl;

public class ClickAdapter extends BaseAdapter<Boolean> {

	public ClickAdapter(BaseTestCase uitest) {
		super(uitest);
	}

	@Override
	public Boolean adapter(Element element) throws Exception {
		String value = element.getStringValue();
		value += ".click()";
		Boolean obj = (Boolean)Ognl.getValue(value, BaseTestCase.context, BaseTestCase.context.getRoot());
		if(!obj) {
			return false;
		}
		return true;
	}

}
